package com.ytjj.qmyx.supplychain.common.enums;

import lombok.Getter;

/**
 * @Description 聚水潭订单状态
 * @ClassName JushuitanOrderStatusEnum
 *
 * 
 * @Version 1.0
 **/

@Getter
public enum JushuitanAfterSaleShopStatusEnum {

    WAIT_SELLER_AGREE("WAIT_SELLER_AGREE", "买家已经申请退款，等待卖家同意"),
    WAIT_BUYER_RETURN_GOODS("WAIT_BUYER_RETURN_GOODS", "卖家已经同意退款，等待买家退货"),
    WAIT_SELLER_CONFIRM_GOODS("WAIT_SELLER_CONFIRM_GOODS", "买家已经退货，等待卖家确认收货"),
    SELLER_REFUSE_BUYER("SELLER_REFUSE_BUYER", "卖家拒绝退款"),
    CLOSED("CLOSED", "退款关闭"),
    SUCCESS("SUCCESS", "退款成功")
    ;


    /**
     * 聚水潭订单状态
     */
    private String code;

    /**
     * 聚水潭订单状态
     */
    private String message;

    JushuitanAfterSaleShopStatusEnum(String code, String message) {
        this.code = code;
        this.message = message;
    }

    public static String getMessageByCode(Integer code){
        for (JushuitanAfterSaleShopStatusEnum value : JushuitanAfterSaleShopStatusEnum.values()) {
            if(value.getCode().equals(code)){
                return value.getMessage();
            }
        }
        return null;
    }

    public static String getCodeByMessage(String message){
        for (JushuitanAfterSaleShopStatusEnum value : JushuitanAfterSaleShopStatusEnum.values()) {
            if(value.getMessage().equals(message)){
                return value.getCode();
            }
        }
        return null;
    }
}
